package com.xwb.service.impl;

import com.xwb.dao.MemberDao;
import com.xwb.domain.Member;
import com.xwb.domain.MemberWithTutor;
import com.xwb.domain.User;
import com.xwb.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberDao memberDao;

    public boolean saveMember(Member member) {
        memberDao.saveInfo(member);
        return true;
    }

    @Override
    public boolean saveMemberInTeam(Member member) {
        memberDao.saveMemberInfo(member);
        return true;
    }

    @Override
    public boolean saveMemberAndTutorInTeam(MemberWithTutor memberWithTutor) {
        memberDao.saveLeaderAndTutorInfo(memberWithTutor);
        return true;
    }

    @Override
    public boolean deleteBySerialNumber(Integer SerialNumber) {
        memberDao.deleteBySerialNumber(SerialNumber);
        return true;
    }

//    @Override
//    public List<MemberWithTutor> selectTheSameTeamInfo(String teamNumber) {
//        return memberDao.selectSameTeamInfo(teamNumber);
//    }

    @Override
    public List<MemberWithTutor> selectByTeamNumber(String teamNumber) {
        return memberDao.selectByTeamNumber(teamNumber);
    }

    @Override
    public void saveUser(User user) {
        memberDao.saveUserInfo(user);
    }


}
